<?php
require('../config.php');

		$gid=$_REQUEST['gid'];
		
		$itemid = $gid;
		$sql="select * from `".$oto."_shoplist` as s where id='{$itemid}'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$item=$row;//将取得的所有数据赋值给person_info数组
		}
		$h=abs(date("H",$item['q_end_time']));
		$i=date("i",$item['q_end_time']);
		$s=date("s",$item['q_end_time']);
		$w=substr($item['q_end_time'],11,3);
		$user_shop_time_add = $h.$i.$s.$w;
		$user_shop_fmod = fmod($user_shop_time_add*100,$item['canyurenshu']);
		
		$time_total = $user_shop_time_add*100;
		$user_shop_time_add = $time_total+$item['opencode'];
		
		if($item['q_content']){
			$item['q_content'] = unserialize($item['q_content']);
			$user_shop_time_add = $item['q_counttime'];
			$user_shop_fmod = fmod($item['q_counttime'],$item['canyurenshu']);
		}
		
		$user_shop_fmod = $item['q_user_code']-10000001;
		$item['picarr'] = unserialize($item['picarr']) ;

		$data[0]['q_end_time_sum']=$user_shop_time_add.'';
		$data[0]['opentime']=$item['opentime'].'';
		$data[0]['opencode']=$item['opencode'].'';
		$data[0]['time_total']=$time_total.'';
		$data[0]['fmod']=$user_shop_fmod.'';
		$data[0]['zongrenshu']=$item['zongrenshu'];

		echo json_encode($data);
?>